package pers.vinsonws.jianghu.clientwin.service;

import pers.vinsonws.jianghu.clientwin.global.Info;
import pers.vinsonws.jianghu.codeCompont.MsgEveryPro;

/**
 * @auther vinsonws
 * @date 2018/11/12 13:17
 */
public class InitChatService {
    public static boolean initClient(){
        MsgEveryPro.Message.Builder builder = MsgEveryPro.Message.newBuilder();
        builder.setType(0);
        builder.setUserSendId(Info.id);
        builder.setDateLong(System.currentTimeMillis());

        Info.channel.writeAndFlush(builder.build());
        getOnlineUser();
        return true;
    }
    private static boolean getOnlineUser(){
        MsgEveryPro.Message.Builder builder = MsgEveryPro.Message.newBuilder();
        builder.setType(12);
        builder.setUserSendId(Info.id);
        builder.setDateLong(System.currentTimeMillis());

        Info.channel.writeAndFlush(builder.build());
        return true;
    }
}
